\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{bbm}
\usepackage{mathrsfs}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{subcaption}
\usepackage{epsfig}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{psfrag}
\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun
\let\vaccent=\v % rename builtin command \v{} to \vaccent{}
\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors
\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} 
\newcommand{\grad}[1]{\gv{\nabla} #1}
\renewcommand{\baselinestretch}{1.2}
\jot 5mm
\graphicspath{{./figures/}}
%text dimensions
\textwidth 6.5 in
\oddsidemargin .2 in
\topmargin -0.2 in
\textheight 8.5 in
\headheight 0.2in
\overfullrule = 0pt
\pagestyle{plain}
\def\newpar{\par\vskip 0.5cm}
\begin{document}
%
%----------------------------------------------------------------------
%        Define symbols
%----------------------------------------------------------------------
%
\def\iso{\mathbbm{1}}
\def\half{{\textstyle{1 \over 2}}}
\def\third{{\textstyle{1 \over 3}}}
\def\fourth{{\textstyle{{1 \over 4}}}}
\def\twothird{{\textstyle {{2 \over 3}}}}
\def\ndim{{n_{\rm dim}}}
\def\nint{n_{\rm int}}
\def\lint{l_{\rm int}}
\def\nel{n_{\rm el}}
\def\nf{n_{\rm f}}
\def\DIV {\hbox{\af div}}
\def\GRAD{\hbox{\af Grad}}
\def\sym{\mathop{\rm sym}\nolimits}
\def\tr{\mathop{\rm tr}\nolimits}
\def\dev{\mathop{\rm dev}\nolimits}
\def\Dev{\mathop{\rm Dev}\nolimits}
\def\DEV{\mathop {\rm DEV}\nolimits}
\def\bfb {{\bi b}}
\def\Bnabla{\nabla}
\def\bG{{\bi G}}
\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}}
\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}}
\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}}
\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}}
\def\ljmp{{\lbrack\!\lbrack}}
\def\rjmp{{\rbrack\!\rbrack}}
\def\sign{{\rm sign}}
\def\nn{{n+1}}
\def\na{{n+\vartheta}}
\def\nna{{n+(1-\vartheta)}}
\def\nt{{n+{1\over 2}}}
\def\nb{{n+\beta}}
\def\nbb{{n+(1-\beta)}}
%---------------------------------------------------------
%               Bold Face Math Characters:
%               All In Format: \B***** .
%---------------------------------------------------------
\def\bOne{\mbox{\boldmath$1$}}
\def\BGamma{\mbox{\boldmath$\Gamma$}}
\def\BDelta{\mbox{\boldmath$\Delta$}}
\def\BTheta{\mbox{\boldmath$\Theta$}}
\def\BLambda{\mbox{\boldmath$\Lambda$}}
\def\BXi{\mbox{\boldmath$\Xi$}}
\def\BPi{\mbox{\boldmath$\Pi$}}
\def\BSigma{\mbox{\boldmath$\Sigma$}}
\def\BUpsilon{\mbox{\boldmath$\Upsilon$}}
\def\BPhi{\mbox{\boldmath$\Phi$}}
\def\BPsi{\mbox{\boldmath$\Psi$}}
\def\BOmega{\mbox{\boldmath$\Omega$}}
\def\Balpha{\mbox{\boldmath$\alpha$}}
\def\Bbeta{\mbox{\boldmath$\beta$}}
\def\Bgamma{\mbox{\boldmath$\gamma$}}
\def\Bdelta{\mbox{\boldmath$\delta$}}
\def\Bepsilon{\mbox{\boldmath$\epsilon$}}
\def\Bzeta{\mbox{\boldmath$\zeta$}}
\def\Beta{\mbox{\boldmath$\eta$}}
\def\Btheta{\mbox{\boldmath$\theta$}}
\def\Biota{\mbox{\boldmath$\iota$}}
\def\Bkappa{\mbox{\boldmath$\kappa$}}
\def\Blambda{\mbox{\boldmath$\lambda$}}
\def\Bmu{\mbox{\boldmath$\mu$}}
\def\Bnu{\mbox{\boldmath$\nu$}}
\def\Bxi{\mbox{\boldmath$\xi$}}
\def\Bpi{\mbox{\boldmath$\pi$}}
\def\Brho{\mbox{\boldmath$\rho$}}
\def\Bsigma{\mbox{\boldmath$\sigma$}}
\def\Btau{\mbox{\boldmath$\tau$}}
\def\Bupsilon{\mbox{\boldmath$\upsilon$}}
\def\Bphi{\mbox{\boldmath$\phi$}}
\def\Bchi{\mbox{\boldmath$\chi$}}
\def\Bpsi{\mbox{\boldmath$\psi$}}
\def\Bomega{\mbox{\boldmath$\omega$}}
\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}}
\def\Bvartheta{\mbox{\boldmath$\vartheta$}}
\def\Bvarpi{\mbox{\boldmath$\varpi$}}
\def\Bvarrho{\mbox{\boldmath$\varrho$}}
\def\Bvarsigma{\mbox{\boldmath$\varsigma$}}
\def\Bvarphi{\mbox{\boldmath$\varphi$}}
\def\bone{\mathbf{1}}
\def\bzero{\mathbf{0}}
%---------------------------------------------------------
%               Bold Face Math Italic:
%               All In Format: \b* .
%---------------------------------------------------------
\def\bA{\mbox{\boldmath$ A$}}
\def\bB{\mbox{\boldmath$ B$}}
\def\bC{\mbox{\boldmath$ C$}}
\def\bD{\mbox{\boldmath$ D$}}
\def\bE{\mbox{\boldmath$ E$}}
\def\bF{\mbox{\boldmath$ F$}}
\def\bG{\mbox{\boldmath$ G$}}
\def\bH{\mbox{\boldmath$ H$}}
\def\bI{\mbox{\boldmath$ I$}}
\def\bJ{\mbox{\boldmath$ J$}}
\def\bK{\mbox{\boldmath$ K$}}
\def\bL{\mbox{\boldmath$ L$}}
\def\bM{\mbox{\boldmath$ M$}}
\def\bN{\mbox{\boldmath$ N$}}
\def\bO{\mbox{\boldmath$ O$}}
\def\bP{\mbox{\boldmath$ P$}}
\def\bQ{\mbox{\boldmath$ Q$}}
\def\bR{\mbox{\boldmath$ R$}}
\def\bS{\mbox{\boldmath$ S$}}
\def\bT{\mbox{\boldmath$ T$}}
\def\bU{\mbox{\boldmath$ U$}}
\def\bV{\mbox{\boldmath$ V$}}
\def\bW{\mbox{\boldmath$ W$}}
\def\bX{\mbox{\boldmath$ X$}}
\def\bY{\mbox{\boldmath$ Y$}}
\def\bZ{\mbox{\boldmath$ Z$}}
\def\ba{\mbox{\boldmath$ a$}}
\def\bb{\mbox{\boldmath$ b$}}
\def\bc{\mbox{\boldmath$ c$}}
\def\bd{\mbox{\boldmath$ d$}}
\def\be{\mbox{\boldmath$ e$}}
\def\bff{\mbox{\boldmath$ f$}}
\def\bg{\mbox{\boldmath$ g$}}
\def\bh{\mbox{\boldmath$ h$}}
\def\bi{\mbox{\boldmath$ i$}}
\def\bj{\mbox{\boldmath$ j$}}
\def\bk{\mbox{\boldmath$ k$}}
\def\bl{\mbox{\boldmath$ l$}}
\def\bm{\mbox{\boldmath$ m$}}
\def\bn{\mbox{\boldmath$ n$}}
\def\bo{\mbox{\boldmath$ o$}}
\def\bp{\mbox{\boldmath$ p$}}
\def\bq{\mbox{\boldmath$ q$}}
\def\br{\mbox{\boldmath$ r$}}
\def\bs{\mbox{\boldmath$ s$}}
\def\bt{\mbox{\boldmath$ t$}}
\def\bu{\mbox{\boldmath$ u$}}
\def\bv{\mbox{\boldmath$ v$}}
\def\bw{\mbox{\boldmath$ w$}}
\def\bx{\mbox{\boldmath$ x$}}
\def\by{\mbox{\boldmath$ y$}}
\def\bz{\mbox{\boldmath$ z$}}
%*********************************
%Start main paper
%*********************************
\centerline{\Large{\bf PRISMS-PF Application Formulation:}}
\smallskip
\centerline{\Large{\bf grainGrowth}}
\bigskip

This example application implements a simple set of governing equations for isotropic grain growth. The model is a simplified version of the one in the following publication:\\
 Simulating recrystallization in titanium using the phase field method, S.P. Gentry and K. Thornton, \emph{IOP Conf. Series: Materials Science and Engineering} 89 (2015) 012024.
\\
\\
Consider a free energy expression of the form:
\begin{equation}
  \Pi(\eta_i, \grad  \eta_i) = \int_{\Omega} \left[\sum_{i=1}^N \left(-\frac{1}{2}\eta_i^2+ \frac{1}{4}\eta_i^4 \right) + \alpha \sum_{i=1}^N \sum_{j>i}^N \eta_i^2 \eta_j^2 +\frac{1}{4} \right] +  \frac{\kappa}{2} \sum_{i=1}^N |\nabla \eta_i|^2    ~dV 
\end{equation}
where $\eta_i$ is one of $N$ structural order parameters, $\alpha$ is the grain interaction coefficient, and $\kappa$ is the gradient energy coefficient.
	
\section{Variational treatment}
The driving force for grain evolution is determined by the variational derivative of the total energy with respect to each order parameter:
\begin{equation}
\mu = \frac{\delta \Pi}{\delta \eta_i} = \left( -\eta_i + \eta_i^3 + 2 \alpha \eta_i \sum_{j \ne i}^N \eta_j^2 - \kappa \nabla^2 \eta_i \right)
\end{equation}

\section{Kinetics}
The order parameter for each grain is unconserved, and thus their evolution can be described by Allen-Cahn equations:
\begin{equation}
\frac{\partial \eta_i}{\partial t} = -L \mu = \left( -\eta_i + \eta_i^3 + 2 \alpha \eta_i \sum_{j \ne i}^N \eta_j^2 - \kappa \nabla^2 \eta_i \right)
\end{equation}
where $L$ is the constant mobility. 
\section{Time discretization}
Considering forward Euler explicit time stepping, we have the time discretized kinetics equation:
\begin{align}
 \eta_i^{n+1} &= \eta_i^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right)
\end{align}
 
\section{Weak formulation}
In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation:
\begin{align}
\int_{\Omega}   w \eta_i^{n+1} ~dV&= \int_{\Omega}   w \eta_i^{n} - w \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) ~dV \\
&= \int_{\Omega}   w ( \underbrace{ \eta^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2\right) }_{r_{\eta_i}} + \grad w \underbrace{ (-\Delta t L \kappa)~ \cdot (\grad \eta_i^{n})}_{r_{\eta_i x}} ~dV \quad [\kappa \grad \eta_i \cdot n = 0 ~ \text{on} ~ \partial \Omega]
\end{align}
\vskip 0.25in
The above values of  $r_{\eta_i}$ and $r_{\eta_i x}$ are used to define the residuals in the following parameters file: \\
\textit{applications/grainGrowth/equations.h}


\end{document} 